home *** CD-ROM | disk | FTP | other *** search
- Path: newsfeed.internetmci.com!gatech!ncar!noao!stsci!usenet
- From: Scott Stallcup <stallcup@stsci.edu>
- Newsgroups: comp.lang.c++,comp.lang.fortran
- Subject: Calling C++ from FORTRAN on VMS
- Date: Thu, 15 Feb 1996 15:52:39 -0500
- Organization: Space Telescope Science Institiute
- Message-ID: <31239D17.3159@stsci.edu>
- NNTP-Posting-Host: empire.stsci.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; SunOS 5.4 sun4m)
- CC: stallcup@stsci.edu
-
- I need to call a C++ routine from a FORTRAN routine on both
- VAX/VMS and AXP/VMS platforms.
-
- The C++ documentation fails to mention mixed langage programs
- (other than calling C from C++)...
-
- Given the following example code, what compiler/linker options
- will resolve the c++ reference ?
-
- ---------------------------------------------------------------
- program tfor
- c
- call tcxx ()
- c
- end
- ---------------------------------------------------------------
-
- #include <stdio.h>
-
- void tcxx (void)
- {
- printf ("Hello World\n");
- }
-
- ---------------------------------------------------------------
- $ fortran tfor
- $ cxx tcxx
- $ link tfor,tcxx
- %LINK-W-NUDFSYMS, 1 undefined symbol:
- %LINK-I-UDFSYM, TCXX
- %LINK-W-USEUNDEF, undefined symbol TCXX referenced
- in psect $LINK$ offset %X00000020
- in module TFOR
- $
-
- ---------------------------------------------------------------
-
- Thanks,
-
- --------------------------------------
- Scott Stallcup (stallcup@stsci.edu)
- Space Telescope Science Institute
-